#include <stdio.h>  
#include <stdlib.h>  
  
int main(int argc, char *argv[]) 
{  
    FILE *outfile = fopen("222.txt", "w");
    if (NULL == outfile) 
    {  
        perror("打开输出文件失败\n");
        return EXIT_FAILURE;  
    }  
  
    for (int i = 1; i < argc; i++) 
    {  
        FILE *infile = fopen(argv[i],"r");
        if (NULL == infile) 
        {  
            perror("打开输入文件失败\n");  
            continue;  
        }  
  
        char buffer[1024];  
        while (fgets(buffer, sizeof(buffer), infile)) 
        {  
            fputs(buffer, outfile);  
        }  
  
        fclose(infile);  
    }  
  
    fclose(outfile);  
    return 0;  
}